import axios from '@/axios'

export default {
    // 获取部门信息
    async axiosGetDept() {
        return await axios({
            url: "/dept/get/department",
            method: "GET"
        })
    },
    async axiosSetDept(oldName, newName) {
        return await axios({
            url: "/dept/alter/department",
            method: "POST",
            params: {
                oldName: oldName,
                newName: newName
            }
        })
    },
    async axiosSetGroup(department, oldName, newName) {
        return await axios({
            url: "/dept/alter/group",
            method: "POST",
            params: {
                department: department,
                oldName: oldName,
                newName: newName
            }
        })
    },
    axiosMvGroup(oldDepartment, newDepartment, group) {
        axios({
            url: "/dept/move/group",
            method: "POST",
            params: {
                oldDepartment: oldDepartment,
                newDepartment: newDepartment,
                group: group
            }
        })
    },
    axiosMkGroup(department, group) {
        axios({
            url: "/dept/create/group",
            method: "POST",
            params: {
                department: department,
                group: group
            }
        })
    },
    axiosRmGroup(department, group) {
        axios({
            url: "/dept/delete/group",
            method: "DELETE",
            params: {
                department: department,
                group: group
            },
        })
    }
}